<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>响应式</title>
    <!-- <script src="./vue.global.js"></script> -->
    <!--引入vue2开发版本的vue核心包-->
    <script src="https://cdn.jsdelivr.net/npm/vue@2.7.10/dist/vue.js"></script>
</head>

<!--
v-model 的修饰符 .trim 去除空格 .number 转数字
-->

<body>
    <div id="app">
        <input type="text" v-on:keyup.enter="show" v-model.trim="context">
        <input type="text" v-on:keyup.enter="show2" v-model.number="content">

    </div>

    <script>
        const app = new Vue({
            el: '#app',
            data: {
                context: '',
                content: ''
            },
            methods: {
                show(e) {
                    console.log(this.context.length)
                },
                show2() {
                    console.log(this.content)
                }
            }
        })
    </script>

</body>

</html>